<template>
    <h2>我是儿子</h2>
    <div>爸爸说： {{ word }}</div>
    <GrandSon></GrandSon>
</template>

<script setup lang='ts'>
import { ref, reactive, inject, provide } from 'vue'
import type {Ref} from 'vue'   // 引入Ref类型，为了给inject中指定类型


import GrandSon from './grandson.vue'

let word = inject<Ref<string>>('word')

let say = ref<string>('我是大哥')
provide('say', say)

</script>
<style scoped>
</style>